package leetcode;

import java.util.HashMap;

public class Test176 {
    public int[] twoSum(int[] nums, int target) {
        int low=0,high=nums.length,sum=0;
        while(low<high){
            sum=nums[low]+nums[high];
            if(sum==target){
                return new int[]{low,high};
            }
            if(sum<target){
                low++;
            }
            if(sum>target){
                high--;
            }
        }
        return null;
    }
}
